import QtQuick 1.0
import QtWebKit 1.0
import com.meego 1.0
import "Article.js" as ArticleUtil

Page {
    id: articleContent
    tools:ModuleToolBar{ }

    orientationLock : PageOrientation.LockPortrait

    property int pageTarget: 111 //动态的时候 再作修改

    property string content_image_title: "../images/articles/content_titleBack.png"
    property string content_image_content: "../images/articles/back.png"
    property string  current_page_index: "1"  //默认显示第一页

    property string article_id:ArticleUtil.getArticleId()//文章id
    property string reply_page_num:ArticleUtil.getReplyPageNum()//评论的页数


    property string article_reply_url: "http://sp.autohome.com.cn/ArticleReply.aspx?id="+article_id;



    BorderImage {
        id: title_image
        width: parent.width

        height: 71
        source: content_image_title
    }
    //页码显示
    Text {
        id: currentIndexText
        x: 196
        y: 22
        text:"第1/"+article_page_num+"页"
        color: "white"
        horizontalAlignment: Text.AlignHCenter
        anchors.horizontalCenter: title_image.horizontalCenter

        font.bold: true
        font.pointSize: 16

    }

      Rectangle{
            id:content_rect
            width:parent.width
            height:parent.height - 71
            anchors.top: title_image.bottom
            BorderImage {
                id: content_image
                width: parent.width
                height: parent.height
                anchors.fill: parent
                opacity: 0.4
                source: content_image_content
            }
            FlickWebView {
                id: web_view
                width: parent.width
                height: parent.height
                anchors.fill: parent
                clip: true
                url: article_reply_url
                onUrlChanged: {
                   var currentUrl= web_view.url;

                    console.log(currentUrl);
                    //标题的显示
                    currentIndexText.text= ArticleUtil.getArticleCurrentPageIndexShowText(currentUrl,reply_page_num);
                }
            }
        }




}

